package useless.wecker;

public class Terminal extends Thread {
    
    public static String TIME = "00:00:00"; //8 chars
    public static String LAST_COMMAND = "                              "; //30 chars
    public static String LAST_COMMAND_LABEL = "last command: "; //14 chars
    public static String NEXT_TIMER = "00:00:00"; // 8 chars
    public static String NEXT_TIMER_LABEL = "next time: "; // 11 chars
    public static String LICHT_STATUS = "Light is off"; //12 chars
    public static String KAFFEE_STATUS = "Coffee is off"; //13 chars
    
    public static void SET_LAST_COMMAND(String cmd){
        int length = cmd.length();
        if (length > 19){
            cmd = cmd.substring(0, 19);
        } else if (length < 19){
            while (length < 19){
                cmd = cmd + " ";
                length++;
            }
        }
        
        
        LAST_COMMAND = TIME + " - " + cmd;
    }
    public static void SET_LICHT_STATUS(Boolean onoff){
        if (onoff){
            LICHT_STATUS = "Light is on!";
        }else{
            LICHT_STATUS = "Light is off";
        }
    }
    public static void SET_KAFFEE_STATUS(Boolean onoff){
        if (onoff){
            KAFFEE_STATUS = "Coffee is on!";
        }else{
            KAFFEE_STATUS = "Coffee is off";
        }
    }
    
    public static void SET_NEXT_TIMER(int stunde, int min, int sekunde){
        String hour = String.valueOf(stunde);
        String minute = String.valueOf(min);
        String second = String.valueOf(sekunde);
        if (hour.length() == 1) hour = "0"+hour;
        if (minute.length() == 1) minute = "0"+minute;
        if (second.length() == 1) second = "0"+second;
        NEXT_TIMER = hour+":"+minute+":"+second;
    }

}
